from concurrent.futures import thread
import time,threading
import _thread
def dif_pwm(s):
    return float(format((s-400)*0.0017,'.3f'))
def send(x):
    while x<=800:
        print(x,dif_pwm(x),threading.current_thread().name)
        x+=100
    return
class thread_pwm_x(threading.Thread):
    # def  _init(self,name):
    #     threading.Thread.__init__(self)
    #     self.name=name
    #     return
    def run(self):
        print('thread_x',threading.current_thread().name)
        send(0)
        return
# thread_x=thread_pwm_x()
# thread_x.start()
# thread_y=thread_pwm_x()
# thread_y.start()
# _thread.start_new_thread(send,(0,))
thread_pwm=threading.Thread(target=send,args=(0,),name="pwm_thread")
thread_pwm.start()
thread_pwm2=threading.Thread(target=send,args=(0,),name="pwm_thread_2")
thread_pwm2.start()
thread_pwm2.join()
print("current_thread",threading.current_thread().name)